﻿using System;
using System.IO;
using System.Reflection;

namespace QuickModel.Basic
{
	public class DirectoryOperator
	{
		public static string BinLocation
		{
			get
			{
				bool flag = string.IsNullOrEmpty(DirectoryOperator.binLocation);
				if (flag)
				{
					DirectoryOperator.binLocation = Assembly.GetExecutingAssembly().Location;
					DirectoryOperator.binLocation = Path.GetDirectoryName(DirectoryOperator.binLocation);
				}
				return DirectoryOperator.binLocation;
			}
		}

		public static string InstallLocation
		{
			get
			{
				bool flag = DirectoryOperator.installLocation == null;
				if (flag)
				{
					DirectoryOperator.installLocation = Path.GetDirectoryName(DirectoryOperator.BinLocation);
				}
				return DirectoryOperator.installLocation;
			}
		}

		public static string FamilyLocation
		{
			get
			{
				return Path.Combine(DirectoryOperator.InstallLocation, "FamilyLib", "Family");
			}
		}

		public static string FamilyImageLocation
		{
			get
			{
				return Path.Combine(DirectoryOperator.InstallLocation, "FamilyLib", "FamilyImage");
			}
		}

		private static string binLocation = string.Empty;

		private static string installLocation;
	}
}
